﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MVVM.Core;
using ObjectModel.Excel;

namespace ViewModels
{
	/// <summary>
	/// View model for specifying a lookupstep type offline range
	/// </summary>
	public class LookUpStepViewModel : ViewModelBase
	{
        private ILookUpStepRange mLookUpStepRange;
        
        public LookUpStepViewModel(ILookUpStepRange lookUpStepRange)
        {
            mLookUpStepRange = lookUpStepRange;

            if (mLookUpStepRange.LookUpSteps != null)
                LookUpSteps = mLookUpStepRange.LookUpSteps;
            else
                LookUpSteps = new LookUpSteps();
        }
        
        public LookUpSteps LookUpSteps { get; set; }

        public void SaveChangesToSource()
        {
            mLookUpStepRange.LookUpSteps = LookUpSteps;
        }

        public void ClearAllLookUpSteps()
        {
            mLookUpStepRange.LookUpSteps = null;

            LookUpSteps = new LookUpSteps();
        }
	}
}
